package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiSrtpReroutingMapper;
import com.ruoyi.net.domain.ElementBusiSrtpRerouting;
import com.ruoyi.net.service.IElementBusiSrtpReroutingService;

/**
 * 网元-业务-srtp-重路由属性Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class ElementBusiSrtpReroutingServiceImpl implements IElementBusiSrtpReroutingService 
{
    @Autowired
    private ElementBusiSrtpReroutingMapper elementBusiSrtpReroutingMapper;

    /**
     * 查询网元-业务-srtp-重路由属性
     * 
     * @param id 网元-业务-srtp-重路由属性主键
     * @return 网元-业务-srtp-重路由属性
     */
    @Override
    public ElementBusiSrtpRerouting selectElementBusiSrtpReroutingById(String id)
    {
        return elementBusiSrtpReroutingMapper.selectElementBusiSrtpReroutingById(id);
    }

    /**
     * 查询网元-业务-srtp-重路由属性列表
     * 
     * @param elementBusiSrtpRerouting 网元-业务-srtp-重路由属性
     * @return 网元-业务-srtp-重路由属性
     */
    @Override
    public List<ElementBusiSrtpRerouting> selectElementBusiSrtpReroutingList(ElementBusiSrtpRerouting elementBusiSrtpRerouting)
    {
        return elementBusiSrtpReroutingMapper.selectElementBusiSrtpReroutingList(elementBusiSrtpRerouting);
    }

    /**
     * 新增网元-业务-srtp-重路由属性
     * 
     * @param elementBusiSrtpRerouting 网元-业务-srtp-重路由属性
     * @return 结果
     */
    @Override
    public int insertElementBusiSrtpRerouting(ElementBusiSrtpRerouting elementBusiSrtpRerouting)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiSrtpRerouting.getId())) {
            elementBusiSrtpRerouting.setId(uuid);
        }
        elementBusiSrtpRerouting.setCreateBy(SecurityUtils.getUsername());
        elementBusiSrtpRerouting.setCreateTime(DateUtils.getNowDate());
        elementBusiSrtpRerouting.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpRerouting.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpReroutingMapper.insertElementBusiSrtpRerouting(elementBusiSrtpRerouting);
    }

    /**
     * 修改网元-业务-srtp-重路由属性
     * 
     * @param elementBusiSrtpRerouting 网元-业务-srtp-重路由属性
     * @return 结果
     */
    @Override
    public int updateElementBusiSrtpRerouting(ElementBusiSrtpRerouting elementBusiSrtpRerouting)
    {
        elementBusiSrtpRerouting.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpRerouting.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpReroutingMapper.updateElementBusiSrtpRerouting(elementBusiSrtpRerouting);
    }

    /**
     * 批量删除网元-业务-srtp-重路由属性
     * 
     * @param ids 需要删除的网元-业务-srtp-重路由属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpReroutingByIds(String[] ids)
    {
        return elementBusiSrtpReroutingMapper.deleteElementBusiSrtpReroutingByIds(ids);
    }

    /**
     * 删除网元-业务-srtp-重路由属性信息
     * 
     * @param id 网元-业务-srtp-重路由属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpReroutingById(String id)
    {
        return elementBusiSrtpReroutingMapper.deleteElementBusiSrtpReroutingById(id);
    }
}
